import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import Vant from 'vant';
import 'vant/lib/index.css';

import App from './App.vue'
import router from './router'
import { useUserStore } from './stores/user';

const app = createApp(App)
const pinia = createPinia()
app.use(pinia)
app.use(router)
app.use(ElementPlus)
app.use(Vant);

// 获取用户状态管理实例
const userStore = useUserStore(pinia);
// 初始化用户状态，从会话存储恢复登录信息
userStore.initUser();

app.mount('#app')